#include <iostream>
#include "complex.h"
#include "ui.h"

using namespace std;

void changed();

int main(int argc, char *argv[])
{

	Gtk::Main kit(argc, argv);
    Glib::RefPtr<Gnome::Glade::Xml> refXml = Gnome::Glade::Xml::create("img/interface.glade");

	Gtk::Window* mainWindow = 0;
	Gtk::TextView* edit = 0;
	Glib::RefPtr<Gtk::TextBuffer> buffer = Gtk::TextBuffer::create();

	refXml->get_widget("window1", mainWindow);
	refXml->get_widget("textview1", edit);
	buffer->set_text("test");
	edit->set_buffer(buffer);

	buffer->signal_changed().connect(sigc::ptr_fun(&changed));	

   	Gtk::Main::run(*mainWindow);
	buffer->set_text("test2");
	Gtk::Main::quit();
    return 0;
}

void changed()
{
cout<<"Zmiana!\n";
}
